#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
using namespace std;
string s1, s2;
int month[] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
int main()
{
    int y1, y2, m1, m2, d1, d2;
    while (cin >> s1 >> s2)
    {
        if (s1 > s2) swap(s1, s2);
        y1 = stoi(s1.substr(0, 4));
        y2 = stoi(s2.substr(0, 4));
        m1 = stoi(s1.substr(4, 2));
        m2 = stoi(s2.substr(4, 2));
        d1 = stoi(s1.substr(6, 2));
        d2 = stoi(s2.substr(6, 2));
        int ans = 1;
        while (1)
        {
            if (y1 == y2 && m1 == m2 && d1 == d2) break;
            d1++, ans++;
            if (m1 == 2 && ((y1 % 4 == 0 && y1 % 100 != 0) || y1 % 400 == 0)) month[2] = 29;
            else month[2] = 28;
            if (d1 > month[m1])
            {
                d1 = 1;
                m1++;
            }
            if (m1 > 12)
            {
                m1 = 1;
                y1++;
            }
            //cout<<y1<<" "<<m1<<" "<<d1<<endl;
        }
        cout << ans << endl;
    }
    return 0;
}